<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第二题</title>
    <style>
        #aa{
            height: 100px;
            width: 100px;
            background-color: orangered;
            /* display:none */
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="dianji">点击</button>
        <div id="aa" v-if="display" >显示</div>
    </div>
</body>
<script src="./vue.js"></script>
<script>

    const{ createApp,ref}=Vue
    createApp({
        setup(){
            // let bb =0
            let display = ref(false)
            function dianji(){               
                // if( display.value){
                //     display.value=false
                // }else{
                //     display.value=true
                // }
                display.value=!display.value
            }
            return{
                dianji,
                display
            }
        }   
    }).mount('#app')
    </script>